package com.zy.bean4.service;

import com.zy.bean4.dao.ProductDao;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

@Service
public class ProductServiceImpl implements ProductService {
    //@Autowired   //自动按类型 注入
   // @Qualifier("productDaoMysqlDao")

    @Resource(name="productDaoCacheDao")
    private ProductDao productDao;

    @Override
    public void add(String pname, double price) {
        productDao.add(pname,price);
    }

    @Override
    public void update(String pname, double price) {
        productDao.update(pname,price);
    }

    @Override
    public double findPrice(String pname) {
      return productDao.findPrice(pname);
    }
}
